<extend name="Public/base"/>
<block name="content">
  <div class="admin-content">
    <div class="admin-content-body">
      <div class="am-cf am-padding am-padding-bottom-0">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">{$title}</strong>  <small></small></div>
      </div>
      <hr/>
      <div class="am-g">
        <div class="am-u-sm-12 am-u-md-8 am-u-md-push-1">
          <form class="am-form am-form-horizontal" action="{:U('add_edit_service')}" method="post">
            <input type="hidden" name="id" value="{$data['id']}">
            <div class="am-form-group">
              <label for="user-name" class="am-u-sm-3 am-form-label">商家ID</label>
              <div class="am-u-sm-9">
                <input type="text" id="user-name" placeholder="" required name="username" value="{$data.username}">
              </div>
            </div>
            <div class="am-form-group">
              <label for="user-name" class="am-u-sm-3 am-form-label">店铺名称</label>
              <div class="am-u-sm-9">
                <input type="text" id="user-name" placeholder="" required name="shopname" value="{$data.shopname}">
              </div>
            </div>

            <div class="am-form-group">
              <label for="user-email" class="am-u-sm-3 am-form-label">姓名</label>
              <div class="am-u-sm-9">
                <input type="text" id="user-email" name="truename" required placeholder="" value="{$data.truename}">
              </div>
            </div>
            <div class="am-form-group">
              <label for="user-email" class="am-u-sm-3 am-form-label">手机号</label>
              <div class="am-u-sm-9">
                <input type="text" id="user-phone" name="phone" required placeholder="" value="{$data.phone}">
              </div>
            </div>
            <div class="am-form-group">
              <label for="user-email" class="am-u-sm-3 am-form-label">身份证号</label>
              <div class="am-u-sm-9">
                <input type="text" id="user-phone1" name="id_card" required placeholder="" value="{$data.id_card}">
              </div>
            </div>
            <!--<div class="am-form-group">-->
            <!--<label for="user-email" class="am-u-sm-3 am-form-label">银行卡号</label>-->
            <!--<div class="am-u-sm-9">-->
            <!--<input type="text" id="user-phone1" name="bank_num" required placeholder="" value="{$data.bank_num}">-->
            <!--</div>-->
            <!--</div>-->
            <!--<div class="am-form-group">-->
              <!--<label for="user-email" class="am-u-sm-3 am-form-label">登录密码</label>-->
              <!--<div class="am-u-sm-9">-->
                <!--<input type="password" id="user-phone2" name="password"  placeholder="" value="888888">-->
                <!--<if condition="$data['id'] neq null">-->
                  <!--<font color="#f00">不修改请留空,默认密码888888</font>-->
                  <!--<else/>-->
                  <!--<font color="#f00">默认密码888888</font>-->
                <!--</if>-->
              <!--</div>-->
            <!--</div>-->
            <!--<div class="am-form-group">-->
              <!--<label for="user-email" class="am-u-sm-3 am-form-label">安全密码</label>-->
              <!--<div class="am-u-sm-9">-->
                <!--<input type="password" id="user-phone4" name="password2"  placeholder="" value="888888">-->
                <!--<if condition="$data['id'] neq null">-->
                  <!--<font color="#f00">不修改请留空,默认密码888888</font>-->
                  <!--<else/>-->
                  <!--<font color="#f00">默认密码888888</font>-->
                <!--</if>-->
              <!--</div>-->
            <!--</div>-->
            <!--<div class="am-form-group">-->
              <!--<label for="user-email" class="am-u-sm-3 am-form-label">推荐人编号</label>-->
              <!--<div class="am-u-sm-9">-->
                <!--<input type="text" id="user-phone1" name="higher" required placeholder="" value="{$data.higher_id}">-->
              <!--</div>-->
            <!--</div>-->
            <!--<div class="am-form-group">-->
              <!--<label for="user-email" class="am-u-sm-3 am-form-label">代理人编号</label>-->
              <!--<div class="am-u-sm-9">-->
                <!--<input type="text" id="user-phone1" name="daili" required placeholder="" value="{$data.service_id}">-->
              <!--</div>-->
            <!--</div>-->

            <!--<div class="am-form-group">-->
            <!--<label for="user-email" class="am-u-sm-3 am-form-label">区域</label>-->
            <!--<div class="am-u-sm-9">-->

            <!--<div class="am-u-sm-9">-->
            <!--&lt;!&ndash;<input type="text" id="user-kj3" name="data" required placeholder="" value="{$data.data}">&ndash;&gt;-->
            <!--<select id="pianqu" name="pianqu" data-am-selected>-->
            <!--<volist name="pianqu" id="vo">-->
            <!--<option value="{$vo.pianquid}" <php>if($vo['pianquid']== $data['pianqu']) echo 'selected'</php> >{$vo.pianqu}</option>-->
            <!--</volist>-->
            <!--</select>-->
            <!--<select id="pro" name="prince" data-am-selected>-->
            <!--<volist name="p" id="vo">-->
            <!--<option value="{$vo.provinceid}" <php>if($vo['provinceid'] == $data['province']) echo 'selected'</php> >{$vo.province}</option>-->
            <!--</volist>-->
            <!--</select>-->
            <!--<select id="city" name="city" data-am-selected>-->
            <!--<volist name="c" id="v">-->
            <!--<option value="{$v.cityid}" <php>if($v['cityid'] == $data['city']) echo 'selected'</php>>{$v.city}</option>-->
            <!--</volist>-->


            <!--</select>-->
            <!--<select id="area" name="area" data-am-selected>-->
            <!--<volist name="a" id="v">-->
            <!--<option value="{$v.areaid}" <php>if($v['areaid'] == $data['area']) echo 'selected'</php>>{$v.area}</option>-->
            <!--</volist>-->
            <!--</select>-->
            <!--</div>-->
            <!--</div>-->
            <!--</div>-->







            <div class="am-form-group">
              <div class="am-u-sm-9 am-u-sm-push-3">
                <button type="submit" class="am-btn am-btn-primary">保存修改</button>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</block>
<block name="js">
  <script>
      $(function () {
          $("#pro").val($('#sale_type_chose1').val());
          $("#city").val($('#sale_type_chose2').val());
          $("#area").val($('#sale_type_chose3').val());

          $('#pianqu').change(function(){
              $.ajax({
                  type:"post",
                  url:"{:U('Public/province_choose')}",
                  data:'pianqu_id='+$('#pianqu').val(),
                  dataType:"json",
                  success:function(data){
                      $('#pro').html(data);
                  }
              });
          });

          $('#pro').change(function(){
              $.ajax({
                  type:"post",
                  url:"{:U('Public/area_choose')}",
                  data:'pro_id='+$('#pro').val(),
                  dataType:"json",
                  success:function(data){
                      $('#city').html(data);
                  }
              });
          });
          $('#city').change(function(){
              $.ajax({
                  type:"post",
                  url:"{:U('Public/city_choose')}",
                  data:'city_id='+$('#city').val(),
                  dataType:"json",
                  success:function(data){
                      $('#area').html(data);
                  }
              });
          });
          var form = $('form');

          $('form').submit(function (e) {

              e.preventDefault();
              $.post(form.attr('action'),form.serialize(),function (data) {
                  layer.msg(data.msg,{time:1000},function () {
                      if(data.code){
                          return false;
                      }else{
                          window.location.href=data.data;
                      }
                  })

              },'json')
          })
      })
  </script>
</block>